﻿@using SunTzu.Utility;
@model form_bussiness
@{
    ViewBag.Title = "商务洽谈对接区专属席位申请";
    Layout = "~/Views/Shared/_LayoutUserCenter.cshtml";
    List<int> scopes = new List<int>();
    if(!string.IsNullOrEmpty(Model.Scope))
    {
        scopes.AddRange(Model.Scope.Split(',').Select(c => c.ParseToInt()));
    }
    
    List<int> purposeNeeds = new List<int>();
    if (!string.IsNullOrEmpty(Model.PurposeNeed))
    {
        purposeNeeds.AddRange(Model.PurposeNeed.Split(',').Select(c => c.ParseToInt()));
    }
    List<int> purposeOffers = new List<int>();
    if (!string.IsNullOrEmpty(Model.PurposeOffer))
    {
        purposeOffers.AddRange(Model.PurposeOffer.Split(',').Select(c => c.ParseToInt()));
    }
    bool isWaiting = Model.Id > 0 && Model.State == 0;
    bool isApproved = Model.State == 1;
}
<script src="/js/exhibitor.js"></script>
    <div class="registerForm registerFormInner">
    <form id="editForm" action="/Bussiness/CreateBussiness?id=@Model.Id" method="post">
        <p class="registerFormTitle">商务洽谈对接区专属席位申请表</p>
        @if (isWaiting)
        {
        <p class="hCent redText">* 您的商务洽谈对接区专属席位申请已经提交，正在等待审核。您可以继续修改以下内容</p>
        }
        else if (isApproved)
        {
        <p class="hCent redText">* 您的商务洽谈对接区专属席位申请已经通过审核。</p>
        }
        <ul>
            <li class="formProp"><span>*</span>单位名称：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Title" id="Title" value="@Model.Title" />
                <span targetId="Title" class="tipMsg">请输入单位名称</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>单位地址：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Address" id="Address" value="@Model.Address" />
                <span targetId="Address" class="tipMsg">请输入单位地址</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>联系人：</li>
            <li class="formLongLine">
                <input type="text" class="inputNormal required" name="Contacter" id="Contacter" value="@Model.Contacter" />
                <span targetId="Contacter" class="tipMsg">请输入联系人</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>联系电话：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Tel" id="Tel" value="@Model.Tel" />
                <span targetId="Tel" class="tipMsg">请输入联系电话</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>手机：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required mobile" name="ContacterMobile" id="ContacterMobile" value="@Model.ContacterMobile" />
                <span targetId="ContacterMobile" class="tipMsg">请输入正确的手机号码</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>传真：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required" name="Fax" id="Fax" value="@Model.Fax" />
                <span targetId="Fax" class="tipMsg">请输入传真</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp"><span>*</span>Email：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong required email" name="Email" id="Email" value="@Model.Email" />
                <span targetId="Email" class="tipMsg">请输入Email</span>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">网址：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="Url" id="Url" value="@Model.Url" />
            </li>
            <li class="clear"></li>
        </ul>
        <div class="registerFormSubTitle">业务范围</div>
        <ul>
            <li class="formProp"><span>*</span>业务范围：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var scope in CacheHelper<code_scope>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(scope.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(scopes.Contains(scope.Id) ? "checked" : "") name="Scope" value="@scope.Id" /> @scope.Title
                        @if (scope.Title == "其他")
                        {
                        <input type="text" name="ScopeOtherName" class="inputNormal" value="@Model.ScopeOtherName" />
                        }
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        
        <div class="registerFormSubTitle">对接内容</div>
        <ul>
            <li class="formProp">寻求：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var purpose in CacheHelper<code_purpose>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(purpose.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(purposeNeeds.Contains(purpose.Id) ? "checked" : "") name="PurposeNeed" value="@purpose.Id" /> @purpose.Title
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">提供：</li>
            <li class="formLongLine">
                <ul class="multiSelections">
                @foreach (var purpose in CacheHelper<code_purpose>.GetAll().OrderBy(c => c.Order))
                {
                    <li @(purpose.Title == "其他" ? "class=multiSelectionInput" : "")>
                        <input type="checkbox" @(purposeOffers.Contains(purpose.Id) ? "checked" : "") name="PurposeOffer" value="@purpose.Id" /> @purpose.Title
                    </li>
                }
                </ul>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">信息标题：</li>
            <li class="formLongLine">
                <input type="text" class="inputLong" name="RequirementTitle" id="RequirementTitle" value="@Model.RequirementTitle" />
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">您的具体需求信息：</li>
            <li class="formLongLine">
                <textarea name="Requirement" id="Requirement" class="textareaLong" rows="6" cols="5">@Model.Requirement</textarea>
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">最少交易/投资金额：</li>
            <li class="formLongLine">
                <input type="text" class="inputNormal" name="Amount" id="Amount" value="@(Model.Amount > 0 ? Model.Amount.ToString() : "")" />
                （不填表示不设限额）
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">提供宣传单/宣传手册/产品样本？</li>
            <li class="formLongLine">
                <input type="radio" name="IsSampleProvided" @(Model.IsSampleProvided ? "checked" : "") value="True" /> 是
                <input type="radio" name="IsSampleProvided" @(!Model.IsSampleProvided ? "checked" : "") value="False"/> 否
                （如有签约项目，请向组委会索取《签约项目申报表》，申报项目）
            </li>
            <li class="clear"></li>
        </ul>
        <ul>
            <li class="formProp">服务需求：</li>
            <li class="formLongLine">
                <textarea name="ServiceRequirement" id="ServiceRequirement" class="textareaLong" rows="6" cols="5">@Model.ServiceRequirement</textarea>
            </li>
            <li class="clear"></li>
        </ul>

        @if (!isApproved)
        {
        <div class="clear"></div>
        <div class="solidLine"></div>
        <div class="buttonBox">
            <a class="smallButton" href="javascript:void()" onclick="$('#editForm').submit();">@(Model.Id == 0 ? "提交" : "保存")</a>
            <div style="display: none">
                <input id="submitbutton" type="submit" value="提  交" />
                <input type="button" value="取  消" />
            </div>
        </div>
        }
    </form>
    </div>
